package com.rajesh.messageservice.helper;

public class QueryStrings {
    //10000 系统消息 436207665 红包消息
    public static final String QUERY_NEW_MESSAGE = "SELECT *, (SELECT VALUE FROM USERINFO WHERE ID = 2 AND TYPE = 3) as userId FROM MESSAGE WHERE TYPE <> 10000 AND TYPE <> 436207665 AND CAST(CREATETIME AS NUMBER) > %d ORDER BY CREATETIME DESC";
    public static final String QUERY_SINGLE_MESSAGE = "SELECT *, (SELECT VALUE FROM USERINFO WHERE ID = 2 AND TYPE = 3) as userId FROM MESSAGE WHERE MSGID = %s";
    public static final String QUERY_ALL_CONTACT = "select (SELECT VALUE FROM USERINFO WHERE ID = 2 AND TYPE = 3) as targetId, username as friendId, (case conRemark when '' then nickname else conRemark end) as nickname from rcontact where nickname != '' and verifyFlag == 0 and chatroomFlag != 1  and type != 0 and type != 33 and encryptUsername != '' and username  not like '%@chatroom' order by pyInitial";
    public static final String QUERY_CURRENT_USER_INFO = "select (select value from UserInfo where id = '2' and type = '3' limit 1) as UserName, (select value as UserName from UserInfo where id = '4' and type = '3' limit 1) as NickName";
    public static final String QUERY_ALL_HEADIMG = "select username,imgflag,lastupdatetime,reserved1,reserved2,reserved3,reserved4 from img_flag where reserved2 is not null and reserved2 != '' and username not like '%@stranger' and username not like '%@bottle'";
    public static final String QUERY_SELF_HEADIMG = "select '' as username, '' as imgflag, '' as lastupdatetime, '' as reserved1, value as reserved2, '' as reserved3, '' as reserved4 from userinfo2 where sid = 'USERINFO_SELFINFO_SMALLIMGURL_STRING' and type = '3'";
    public static final String QUERY_NEW_APPATTACH = "select mediaSvrId,fileFullPath,createTime from appattach where type = 6 and totalLen = offset and CAST(createTime AS NUMBER) > %d ORDER BY createTime DESC";
}
